package com.PAT.UnSatisfying;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2022/02/10/0:57
 * @Description:
 * @Target: 差4
 */
public class 完美数列 {
    public static void main(String[] args)  {
        Scanner in = new Scanner(System.in);
        String ss1 = in.nextLine();
        String[] s = ss1.split(" ");
        int N = Integer.valueOf(s[0]);
        long p = Integer.valueOf(s[1]);

        long[] NArray = new long[N];
        long max = Integer.MIN_VALUE;
        for (int i = 0; i < N; i++) {
            NArray[i] = in.nextInt();
        }

        Arrays.sort(NArray);

        int count = 0;


        // 一个m(最小值),一个M(最大值),我需要判断他俩间的距离.--求得最长距离
        for (int j = N-1; j > 0 ; j--) {   // 用于M
            for (int i = 0; i <= j; i++) {  // 用于m
                if(NArray[i]*p<NArray[j]){
//                    System.out.println(NArray[i]+"*"+p+"<"+NArray[j]+"?");
//                    break;

                }else {
//                    System.out.println(NArray[i]+"*"+p+">="+NArray[j]+"?");
                    count++;
                }
            }
            max = Math.max(count,max);
            count=0;
        }












            System.out.println(max);


    }
}
